Skip to content

Fix RCS0036 for blank lines in records - #1813

Merged
josefpihrt merged 3 commits into
mainfrom
fix/rcs0036-records
Aug 14, 2026
Merged

Fix RCS0036 for blank lines in records#1813
josefpihrt merged 3 commits into
mainfrom
fix/rcs0036-records

Conversation

@josefpihrt

@josefpihrt josefpihrt commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • RCS0036 now visits record declarations, so blank lines between consecutive single-line properties (and other same-kind members) are reported the same way as in classes.
  • The shared BlankLineBetweenDeclarationsAnalyzer registration also covers RCS0009, RCS0010, RCS0012, and RCS0013 inside records.
  • Adds a regression test matching the issue reproduction.

Fixes #1812

Test plan

  • dotnet test Tests/Formatting.Analyzers.Tests --filter "FullyQualifiedName~RCS0036" (8 passed)
  • Confirm the issue reproduction (record with two single-line properties separated by a blank line) reports RCS0036 and the code fix removes the blank line

Josef Pihrt and others added 3 commits August 14, 2026 18:26
RCS0036 already visited classes, structs, and record structs, but never registered RecordDeclaration, so equivalent properties in a record were ignored.

Co-authored-by: Cursor <cursoragent@cursor.com>
A markdown issue link alone does not create a GitHub closing reference.

Co-authored-by: Cursor <cursoragent@cursor.com>
Changelog entries use ([PR](...)) links; tighten the bug-fix skill examples to match.

Co-authored-by: Cursor <cursoragent@cursor.com>
@josefpihrt
josefpihrt merged commit b104db7 into main Aug 14, 2026
17 checks passed
@josefpihrt
josefpihrt deleted the fix/rcs0036-records branch August 14, 2026 17:20
This was referenced Aug 16, 2026
This was referenced Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RCS0036 does not report blank lines between single-line properties in records

1 participant